package com.guigu.youxuan.mapper;

import com.guigu.youxuan.pojo.OrderInfo;
import com.guigu.youxuan.pojo.PurchaseOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.guigu.youxuan.pojo.SupplierInfo;
import com.guigu.youxuan.pojo.dto.PurchaseReviewDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liweixin
 * @since 2024-05-15
 */
public interface PurchaseOrderMapper extends BaseMapper<PurchaseOrder> {

    /**
     * 根据供应商id查询和供应商对应的订单
     * @return
     */
    List<PurchaseOrder> list(int supplierId);

    @Select("select * from purchase_order where purchase_id = (select Max(purchase_id) from purchase_order)  ")
    PurchaseOrder getMaxDesignId();

    List<PurchaseReviewDto> queryPurchaseReview(@Param("supplierInfo")SupplierInfo supplierInfo);

    List<PurchaseReviewDto> queryPurchaseReviewOk(@Param("supplierInfo")SupplierInfo supplierInfo);

}
